package ru.omsu.diveintoandroid.funnycats.scenes;

import org.cocos2d.layers.CCLayer;
import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCLabel;
import org.cocos2d.types.CGPoint;

import android.view.KeyEvent;

public class RaitingScene extends CCLayer{
	public static CCScene scene(){
		CCScene scene = CCScene.node();
		CCLayer layer = new RaitingScene();
		scene.addChild(layer);
		return scene;
	}
	
	public RaitingScene(){
		CCLabel lbl = CCLabel.makeLabel("Sorry, but this part not ready yet", "DroidSans", 16);
		lbl.setPosition(CGPoint.ccp(CCDirector.sharedDirector().winSize().width/2, 
				CCDirector.sharedDirector().winSize().height - 16f));
		addChild(lbl,0);
	}
	
	@Override
	public boolean ccKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			CCDirector.sharedDirector().runWithScene(MainScene.scene());
			return true;
		}
		
		return super.ccKeyDown(keyCode, event);
	}	
}
